<%-- 
    Document   : mailForm
    Created on : 9.3.2012
    Author     : VERNER Jan
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    response.addHeader("Cache-Control", "no-store");
%>

<jsp:useBean id="emailBean"
             class="cz.vse.javaee.email.EmailBean"
             scope="session"/>

<html>
<head><title>E-mail formulář</title></head>
<body>
    <h1>Formulář pro email</h1>
    <h2>Uživatel: ${emailBean.user}</h2>

    <form action="sendMail" method="post">
        <input id="action" type="hidden" name="action" value="">
        <label for="to">Komu:</label><br/>
        <input id="to" name="to" type="text" value=${emailBean.to}>
        <br/>
        <label for="subject">Předmět:</label><br/>
        <input id="subject" name="subject" type="text" value=${emailBean.subject}>
        <br/>
        <label for="message">Zpráva:</label><br/>
        <textarea id="message" name="message" rows="20" cols="60">${emailBean.body}</textarea>
        <br/>
        <input type="submit" onclick="document.getElementById('action').value='send'" value="Send"/>
        <input type="submit" onclick="document.getElementById('action').value='store'" value="Store"/>

    </form>
        
    <form action="sendMail" method="post">
        <input type="hidden" name="action" value="restore"/>
        <input type="submit" value="Restore"/>
    </form>
    
    <form action="logout" method="post">
        <input type="hidden" name="action" value="doLogout"/>
        <input type="submit" value="Logout"/>
    </form>

</body>
</html>
